﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Globalization;
using SuperSurvey.Entity;
using SuperSurvey.DAO;
using System.Data.SqlClient;

namespace SuperSurvey.BUS
{
    public class RegisterBus
    {
        // get all country in the world
        public static List<string> CountryList()
        {
            List<string> cultureList = new List<string>();

            CultureInfo[] getCultureInfo = CultureInfo.GetCultures(CultureTypes.SpecificCultures);
            foreach (CultureInfo getCulture in getCultureInfo)
            {
                RegionInfo getRegionInfo = new RegionInfo(getCulture.LCID);
                if (!(cultureList.Contains(getRegionInfo.EnglishName)))
                {
                    cultureList.Add(getRegionInfo.EnglishName);
                }
            }
            cultureList.Sort();
            return cultureList;
        }

        public static bool InsertAccount(UserLogin ul,UserInformation uf)
        {
            string sp = RegisterDAO.insertAccount;
            SqlParameter[] sqlParameter = RegisterDAO.InsertAccount(ul, uf);
            bool b = DatabaseInteraction.InteractionData(sp, sqlParameter);
            return b;
        }
    }
}